package day18;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

/**
 * @author ZJX
 * @version 1.0
 * @descption
 * @since 2025/10/28 19:14
 */
public class Day15 {
    public static void main(String[] args) throws IOException {
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        PrintWriter out = new PrintWriter(System.out);
        in.nextToken();
        long x = (long) in.nval;
        long k = (long) Math.sqrt(x);
        long x1 = k * k;
        long x2 = (k + 1) * (k + 1);
        if (Math.abs(x - x1) > Math.abs(x - x2)) {
            out.println(x2);
        } else {
            out.println(x1);
        }
        out.close();
    }

    public int splitArray(int[] nums, int k) {
        int left = 0, right = 0;
        for (int n : nums) {
            left = Math.max(left, n);
            right += n;
        }
        while (right > left) {
            int mid = left + (right - left) / 2;
            if (canSplit(nums, k, mid)) {
                right = mid;
            } else {
                left = mid + 1;
            }
        }
        return left;
    }

    private boolean canSplit(int[] nums, int k, int maxSum) {
        int count = 1;
        int curSum = 0;
        for (int n : nums) {
            curSum += n;
            if (curSum > maxSum) {
                count++;
                curSum = n;
                if (count > k) {
                    return false;
                }
            }
        }
        return true;
    }

    public List<Integer> findDuplicates(int[] nums) {
        List<Integer> ret = new ArrayList<>();
        int[] table = new int[nums.length + 1];
        for (int n : nums) {
            if (table[n] == 0) {
                table[n] = 1;
            } else {
                ret.add(n);
            }
        }
        return ret;
    }
}

